package com.demo.rxjavademo.http;

import com.demo.rxjavademo.mode.BeforeNewsInfo;
import com.demo.rxjavademo.mode.LastNewsInfo;
import com.demo.rxjavademo.mode.SplashInfo;

import io.reactivex.Flowable;
import retrofit2.http.GET;
import retrofit2.http.Headers;
import retrofit2.http.Path;

/**
 * Created by Administrator on 2016/12/19.
 */

public interface ApiStores {
    String API_SERVER_URL = "http://news-at.zhihu.com/api/4/";

    //添加Header即设置缓存
    @Headers("Cache-Control:public,max-age=60")
    @GET("start-image/{resolution}")
    Flowable<SplashInfo> getSplash(@Path("resolution") String resolution);

    //=====
    // 主界面Item
    //=====
    //  http://news-at.zhihu.com/api/4/news/latest
    @GET("news/{date}")
    Flowable<LastNewsInfo> getLastNews(@Path("date") String date);

    //=====
    // 主界面Item
    //=====
    //  http://news-at.zhihu.com/api/4/news/before/20161024
    @GET("news/before/{date}")
    Flowable<BeforeNewsInfo> getBeforeNews(@Path("date") String date);
}
